<template>
  <el-container>
    <el-header style="height: 100px">
      <h1>首页</h1>
    </el-header>
    <el-main>
      <el-button @click="btnTestGet">点击Get</el-button>
      <el-button @click="btnTestPost">点击Post</el-button>
      <div class="index-button">
        <el-button type="primary" @click="$router.push('/login')">公会登录</el-button>
      </div>
    </el-main>
    <el-footer>
    </el-footer>
  </el-container>
</template>
<script>
export default {
  data() {
    return {
      // imgList: [
      //   require("../assets/img/banner1.webp"),
      //   require("../assets/img/banner2.webp"),
      //   require("../assets/img/banner3.webp"),
      //   require("../assets/img/banner4.webp"),
      // ],
    };
  },
  created() { },
  methods: {
    btnTestGet() {
      this.$api.testGet()
        .then((res) => {
          console.log(res, "----------");
        })
        .catch((err) => {
          console.log(err, "====登录错误");
        });
    },
    btnTestPost() {
      this.$api.testPost()
        .then((res) => {
          console.log(res, "----------");
        })
        .catch((err) => {
          console.log(err, "====登录错误");
        });
    }
  },
};
</script>
<style lang="less" scoped>
body>.el-container {
  margin-bottom: 40px;
}

.el-header {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  margin-top: 20px;
}

.avatar-img {
  width: 100px;
  height: 100px;
  margin-right: 10px;
}

.index-button {
  width: 300px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
}


.el-footer {
  margin-top: 200px;
  text-align: center;
}
</style>